package kgc.crm.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
    * 商机表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "kgc_crm_crm_business")
public class Business {
    @TableId(value = "business_id", type = IdType.AUTO)
    private Integer businessId;

    /**
     * 商机状态组
     */
    @TableField(value = "type_id")
    private Integer typeId;

    /**
     * 销售阶段
     */
    @TableField(value = "status_id")
    private Integer statusId;

    /**
     * 下次联系时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "next_time")
    private Date nextTime;

    /**
     * 客户ID
     */
    @TableField(value = "customer_id")
    private Integer customerId;

    /**
     * 预计成交日期
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "deal_date")
    private Date dealDate;

    /**
     * 商机名称
     */
    @TableField(value = "business_name")
    private String businessName;

    /**
     * 商机金额
     */
    @TableField(value = "money")
    private BigDecimal money;

    /**
     * 整单折扣
     */
    @TableField(value = "discount_rate")
    private BigDecimal discountRate;

    /**
     * 产品总金额
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 创建人ID
     */
    @TableField(value = "create_user_id")
    private Long createUserId;

    /**
     * 负责人ID
     */
    @TableField(value = "owner_user_id")
    private Long ownerUserId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 批次 比如附件批次
     */
    @TableField(value = "batch_id")
    private String batchId;

    /**
     * 只读权限
     */
    @TableField(value = "ro_user_id")
    private String roUserId;

    /**
     * 读写权限
     */
    @TableField(value = "rw_user_id")
    private String rwUserId;

    /**
     * 1赢单2输单3无效
     */
    @TableField(value = "is_end")
    private Integer isEnd;

    @TableField(value = "status_remark")
    private String statusRemark;


    @TableField(exist = false)// 是否在mp中生效
    private String  userName;
    @TableField(exist = false)// 是否在mp中生效
    private String  typeName;
    @TableField(exist = false)// 是否在mp中生效
    private String  bstatusName;

    @TableField(exist = false)// 是否在mp中生效
    private String  customerName;
    @TableField(exist = false)// 是否在mp中生效
    private String  deptName;

    public static final String COL_BUSINESS_ID = "business_id";

    public static final String COL_TYPE_ID = "type_id";

    public static final String COL_STATUS_ID = "status_id";

    public static final String COL_NEXT_TIME = "next_time";

    public static final String COL_CUSTOMER_ID = "customer_id";

    public static final String COL_DEAL_DATE = "deal_date";

    public static final String COL_BUSINESS_NAME = "business_name";

    public static final String COL_MONEY = "money";

    public static final String COL_DISCOUNT_RATE = "discount_rate";

    public static final String COL_TOTAL_PRICE = "total_price";

    public static final String COL_REMARK = "remark";

    public static final String COL_CREATE_USER_ID = "create_user_id";

    public static final String COL_OWNER_USER_ID = "owner_user_id";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";

    public static final String COL_BATCH_ID = "batch_id";

    public static final String COL_RO_USER_ID = "ro_user_id";

    public static final String COL_RW_USER_ID = "rw_user_id";

    public static final String COL_IS_END = "is_end";

    public static final String COL_STATUS_REMARK = "status_remark";
}